package Offer;

/**
 * @Author: wangliuyang
 * @Date: 2021/6/9 17:13
 * @Description: 剑指 Offer 10- II. 青蛙跳台阶问题
 */
public class FrogClimbingStairs {
    public int numWays(int n) {
        if(n == 0 || n==1) {
            return 1;
        }
        int a = 1 ,b = 1,sum = 0;
        for(int i = 1; i < n; i++) {
            sum = a + b;
            sum %= 1000000007;
            a = b;
            b = sum;
        }
        return sum;
    }
}